home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / phy-bstyles / ppcf.bst < prev    next >
Text File  |  1992-06-14  |  21KB  |  1,124 lines

  1. %% #define PPCF 1        % Thu Jun 14 13:27:54 1990
  2. %% #include "TEX$ROOT:[BIBTEX]PHYSICS.BTX"
  3.     % Please notify Charles Karney (Karney@Princeton.EDU)
  4.     % of any bugs, improvements, etc.
  5.  
  6.     % A physics version of APALIKE
  7.  
  8.     % version 0.99b for BibTeX versions 0.99a or later, LaTeX version 2.09.
  9.     % Copyright (C) 1985, all rights reserved.
  10.     % Copying of this file is authorized only if either
  11.     % (1) you make absolutely no changes to your copy, including name, or
  12.     % (2) if you do make changes, you name it something other than
  13.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  14.     % This restriction helps ensure that all standard styles are identical.
  15.     % The file btxbst.doc has the documentation for this style.
  16.  
  17. ENTRY
  18.   { address
  19.     author
  20.     booktitle
  21.     chapter
  22.     edition
  23.     editor
  24.     howpublished
  25.     institution
  26.     journal
  27.     key
  28.     note
  29.     number
  30.     organization
  31.     pages
  32.     publisher
  33.     school
  34.     series
  35.     title
  36.     type
  37.     volume
  38.     year
  39.   }
  40.   {}
  41.   { label extra.label sort.label }
  42.  
  43. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  44.  
  45. FUNCTION {init.state.consts}
  46. { #0 'before.all :=
  47.   #1 'mid.sentence :=
  48.   #2 'after.sentence :=
  49.   #3 'after.block :=
  50. }
  51.  
  52. STRINGS { s t }
  53.  
  54. FUNCTION {output.nonnull}
  55. { 's :=
  56.   output.state mid.sentence =
  57.     { ", " * write$ }
  58.     { output.state after.block =
  59.     { add.period$ write$
  60.       newline$
  61.       "\newblock " write$
  62.     }
  63.     { output.state before.all =
  64.         'write$
  65.         { add.period$ " " * write$ }
  66.       if$
  67.     }
  68.       if$
  69.       mid.sentence 'output.state :=
  70.     }
  71.   if$
  72.   s
  73. }
  74.  
  75. FUNCTION {output}
  76. { duplicate$ empty$
  77.     'pop$
  78.     'output.nonnull
  79.   if$
  80. }
  81.  
  82. FUNCTION {output.check}
  83. { 't :=
  84.   duplicate$ empty$
  85.     { pop$ "empty " t * " in " * cite$ * warning$ }
  86.     'output.nonnull
  87.   if$
  88. }
  89.  
  90. FUNCTION {output.year.check}
  91. { year empty$
  92.     { "empty year in " cite$ * warning$ }
  93.     { write$
  94.       " (" year * extra.label * ")" *
  95.       mid.sentence 'output.state :=
  96.     }
  97.   if$
  98. }
  99.  
  100. FUNCTION {output.bibitem}
  101. { newline$
  102.   "\bibitem[" write$
  103.   label write$
  104.   "]{" write$
  105.   cite$ write$
  106.   "}" write$
  107.   newline$
  108.   ""
  109.   before.all 'output.state :=
  110. }
  111.  
  112. FUNCTION {fin.entry}
  113. { add.period$
  114.   write$
  115.   newline$
  116. }
  117.  
  118. FUNCTION {new.block}
  119. { output.state before.all =
  120.     'skip$
  121.     { after.block 'output.state := }
  122.   if$
  123. }
  124.  
  125. FUNCTION {new.sentence}
  126. { output.state after.block =
  127.     'skip$
  128.     { output.state before.all =
  129.     'skip$
  130.     { after.sentence 'output.state := }
  131.       if$
  132.     }
  133.   if$
  134. }
  135.  
  136. FUNCTION {not}
  137. {   { #0 }
  138.     { #1 }
  139.   if$
  140. }
  141.  
  142. FUNCTION {and}
  143. {   'skip$
  144.     { pop$ #0 }
  145.   if$
  146. }
  147.  
  148. FUNCTION {or}
  149. {   { pop$ #1 }
  150.     'skip$
  151.   if$
  152. }
  153.  
  154. FUNCTION {new.block.checkb}
  155. { empty$
  156.   swap$ empty$
  157.   and
  158.     'skip$
  159.     'new.block
  160.   if$
  161. }
  162.  
  163. FUNCTION {field.or.null}
  164. { duplicate$ empty$
  165.     { pop$ "" }
  166.     'skip$
  167.   if$
  168. }
  169.  
  170. FUNCTION {emphasize}
  171. { duplicate$ empty$
  172.     { pop$ "" }
  173.     { "{\em " swap$ * "}" * }
  174.   if$
  175. }
  176.  
  177. FUNCTION {caps}
  178. { duplicate$ empty$
  179.     { pop$ "" }
  180.     { "{\sc " swap$ * "}" * }
  181.   if$
  182. }
  183.  
  184. FUNCTION {embolden}
  185. { duplicate$ empty$
  186.     { pop$ "" }
  187.     { "{\bf " swap$ * "}" * }
  188.   if$
  189. }
  190.  
  191. INTEGERS { nameptr namesleft numnames }
  192.  
  193. FUNCTION {format.names}
  194. { 's :=
  195.   #1 'nameptr :=
  196.   s num.names$ 'numnames :=
  197.   numnames 'namesleft :=
  198.     { namesleft #0 > }
  199.     { s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't :=   % last name first
  200.       t "others" =
  201.     'skip$
  202.     { t caps 't := }
  203.       if$
  204.       nameptr #1 >
  205.     { namesleft #1 >
  206.         { ", " * t * }
  207.         { numnames #2 >
  208.         { "," * }
  209.         'skip$
  210.           if$
  211.           t "others" =
  212.         { " {\em et~al.}" * }
  213.         { " and " * t * }
  214.           if$
  215.         }
  216.       if$
  217.     }
  218.     't
  219.       if$
  220.       nameptr #1 + 'nameptr :=
  221.       namesleft #1 - 'namesleft :=
  222.     }
  223.   while$
  224. }
  225.  
  226. FUNCTION {format.authors}
  227. { author empty$
  228.     { "" }
  229.     { author format.names }
  230.   if$
  231. }
  232.  
  233. FUNCTION {format.key}            % this function is just for apalike
  234. { empty$
  235.     { key field.or.null }
  236.     { "" }
  237.   if$
  238. }
  239.  
  240. FUNCTION {format.editors}
  241. { editor empty$
  242.     { "" }
  243.     { editor format.names
  244.       editor num.names$ #1 >
  245.     { ", editors" * }
  246.     { ", editor" * }
  247.       if$
  248.     }
  249.   if$
  250. }
  251.  
  252. FUNCTION {format.title}
  253. { title empty$
  254.     { "" }
  255.     'title
  256.   if$
  257. }
  258.  
  259. FUNCTION {n.dashify}
  260. { 't :=
  261.   ""
  262.     { t empty$ not }
  263.     { t #1 #1 substring$ "-" =
  264.     { t #1 #2 substring$ "--" = not
  265.         { "--" *
  266.           t #2 global.max$ substring$ 't :=
  267.         }
  268.         {   { t #1 #1 substring$ "-" = }
  269.         { "-" *
  270.           t #2 global.max$ substring$ 't :=
  271.         }
  272.           while$
  273.         }
  274.       if$
  275.     }
  276.     { t #1 #1 substring$ *
  277.       t #2 global.max$ substring$ 't :=
  278.     }
  279.       if$
  280.     }
  281.   while$
  282. }
  283.  
  284. FUNCTION {format.btitle}
  285. { title emphasize
  286. }
  287.  
  288. FUNCTION {tie.or.space.connect}
  289. { duplicate$ text.length$ #3 <
  290.     { "~" }
  291.     { " " }
  292.   if$
  293.   swap$ * *
  294. }
  295.  
  296. FUNCTION {either.or.check}
  297. { empty$
  298.     'pop$
  299.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  300.   if$
  301. }
  302.  
  303. FUNCTION {format.bvolume}
  304. { volume empty$
  305.     { "" }
  306.     { "volume" volume tie.or.space.connect
  307.       series empty$
  308.     'skip$
  309.     { " of " * series emphasize * }
  310.       if$
  311.       "volume and number" number either.or.check
  312.     }
  313.   if$
  314. }
  315.  
  316. FUNCTION {format.number.series}
  317. { volume empty$
  318.     { number empty$
  319.     { series field.or.null }
  320.     { output.state mid.sentence =
  321.         { "number" }
  322.         { "Number" }
  323.       if$
  324.       number tie.or.space.connect
  325.       series empty$
  326.         { "there's a number but no series in " cite$ * warning$ }
  327.         { " in " * series * }
  328.       if$
  329.     }
  330.       if$
  331.     }
  332.     { "" }
  333.   if$
  334. }
  335.  
  336. FUNCTION {format.edition}
  337. { edition empty$
  338.     { "" }
  339.     { output.state mid.sentence =
  340.     { edition "l" change.case$ " edition" * }
  341.     { edition "t" change.case$ " edition" * }
  342.       if$
  343.     }
  344.   if$
  345. }
  346.  
  347. INTEGERS { multiresult }
  348.  
  349. FUNCTION {multi.page.check}
  350. { 't :=
  351.   #0 'multiresult :=
  352.     { multiresult not
  353.       t empty$ not
  354.       and
  355.     }
  356.     { t #1 #1 substring$
  357.       duplicate$ "-" =
  358.       swap$ duplicate$ "," =
  359.       swap$ "+" =
  360.       or or
  361.     { #1 'multiresult := }
  362.     { t #2 global.max$ substring$ 't := }
  363.       if$
  364.     }
  365.   while$
  366.   multiresult
  367. }
  368.  
  369. FUNCTION {format.pages}
  370. { pages empty$
  371.     { "" }
  372.     { pages multi.page.check
  373.     { "pages" pages n.dashify tie.or.space.connect }
  374.     { "page" pages tie.or.space.connect }
  375.       if$
  376.     }
  377.   if$
  378. }
  379.  
  380. FUNCTION {format.vol.num.pages}
  381. { volume field.or.null embolden
  382.   " " swap$ * *
  383.   pages empty$
  384.     'skip$
  385.     { duplicate$ empty$
  386.     { pop$ format.pages }
  387.     { ", " * pages n.dashify * }
  388.       if$
  389.     }
  390.   if$
  391. }
  392.  
  393. FUNCTION {format.chapter.pages}
  394. { chapter empty$
  395.     'format.pages
  396.     { type empty$
  397.     { "chapter" }
  398.     { type "l" change.case$ }
  399.       if$
  400.       chapter tie.or.space.connect
  401.       pages empty$
  402.     'skip$
  403.     { ", " * format.pages * }
  404.       if$
  405.     }
  406.   if$
  407. }
  408.  
  409. FUNCTION {format.in.ed.booktitle}
  410. { booktitle empty$
  411.     { "" }
  412.     { editor empty$
  413.     { "In " booktitle emphasize * }
  414.     { "In " format.editors * ", " * booktitle emphasize * }
  415.       if$
  416.     }
  417.   if$
  418. }
  419.  
  420. FUNCTION {format.thesis.type}
  421. { type empty$
  422.     'skip$
  423.     { pop$
  424.       type "t" change.case$
  425.     }
  426.   if$
  427. }
  428.  
  429. FUNCTION {format.tr.number}
  430. { type empty$
  431.     { "Technical Report" }
  432.     'type
  433.   if$
  434.   number empty$
  435.     { "t" change.case$ }
  436.     { number tie.or.space.connect }
  437.   if$
  438. }
  439.  
  440. FUNCTION {format.article.crossref}
  441. { "In"                            % this is for apalike
  442.   " \cite{" * crossref * "}" *
  443. }
  444.  
  445. FUNCTION {format.book.crossref}
  446. { volume empty$
  447.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  448.       "In "
  449.     }
  450.     { "Volume" volume tie.or.space.connect
  451.       " of " *
  452.     }
  453.   if$
  454.   "\cite{" * crossref * "}" *                % this is for apalike
  455. }
  456.  
  457. FUNCTION {format.incoll.inproc.crossref}
  458. { "In"                            % this is for apalike
  459.   " \cite{" * crossref * "}" *
  460. }
  461.  
  462. FUNCTION {article}
  463. { output.bibitem
  464.   format.authors "author" output.check
  465.   author format.key output                % special for
  466.   output.year.check                    % apalike
  467.   new.block
  468.   crossref missing$
  469.     { journal emphasize
  470.       format.vol.num.pages output
  471.     }
  472.     { format.article.crossref output.nonnull
  473.       format.pages output
  474.     }
  475.   if$
  476.   new.block
  477.   note output
  478.   fin.entry
  479. }
  480.  
  481. FUNCTION {book}
  482. { output.bibitem
  483.   author empty$
  484.     { format.editors "author and editor" output.check
  485.       editor format.key output
  486.     }
  487.     { format.authors output.nonnull
  488.       crossref missing$
  489.     { "author and editor" editor either.or.check }
  490.     'skip$
  491.       if$
  492.     }
  493.   if$
  494.   output.year.check                % special for apalike
  495.   new.block
  496.   format.btitle "title" output.check
  497.   crossref missing$
  498.     { format.bvolume output
  499.       new.block
  500.       format.number.series output
  501.       new.sentence
  502.       publisher "publisher" output.check
  503.       address output
  504.     }
  505.     { new.block
  506.       format.book.crossref output.nonnull
  507.     }
  508.   if$
  509.   format.edition output
  510.   new.block
  511.   note output
  512.   fin.entry
  513. }
  514.  
  515. FUNCTION {booklet}
  516. { output.bibitem
  517.   format.authors output
  518.   author format.key output                % special for
  519.   output.year.check                    % apalike
  520.   new.block
  521.   format.title "title" output.check
  522.   new.block
  523.   howpublished output
  524.   address output
  525.   new.block
  526.   note output
  527.   fin.entry
  528. }
  529.  
  530. FUNCTION {inbook}
  531. { output.bibitem
  532.   author empty$
  533.     { format.editors "author and editor" output.check
  534.       editor format.key output
  535.     }
  536.     { format.authors output.nonnull
  537.       crossref missing$
  538.     { "author and editor" editor either.or.check }
  539.     'skip$
  540.       if$
  541.     }
  542.   if$
  543.   output.year.check                % special for apalike
  544.   new.block
  545.   format.btitle "title" output.check
  546.   crossref missing$
  547.     { format.bvolume output
  548.       format.chapter.pages "chapter and pages" output.check
  549.       new.block
  550.       format.number.series output
  551.       new.sentence
  552.       publisher "publisher" output.check
  553.       address output
  554.     }
  555.     { format.chapter.pages "chapter and pages" output.check
  556.       new.block
  557.       format.book.crossref output.nonnull
  558.     }
  559.   if$
  560.   format.edition output
  561.   new.block
  562.   note output
  563.   fin.entry
  564. }
  565.  
  566. FUNCTION {incollection}
  567. { output.bibitem
  568.   format.authors "author" output.check
  569.   author format.key output                % special for
  570.   output.year.check                    % apalike
  571.   new.block
  572.   format.title "title" output.check
  573.   new.block
  574.   crossref missing$
  575.     { format.in.ed.booktitle "booktitle" output.check
  576.       format.bvolume output
  577.       format.number.series output
  578.       format.chapter.pages output
  579.       new.sentence
  580.       publisher "publisher" output.check
  581.       address output
  582.       format.edition output
  583.     }
  584.     { format.incoll.inproc.crossref output.nonnull
  585.       format.chapter.pages output
  586.     }
  587.   if$
  588.   new.block
  589.   note output
  590.   fin.entry
  591. }
  592.  
  593. FUNCTION {inproceedings}
  594. { output.bibitem
  595.   format.authors "author" output.check
  596.   author format.key output                % special for
  597.   output.year.check                    % apalike
  598.   new.block
  599.   format.title "title" output.check
  600.   new.block
  601.   crossref missing$
  602.     { format.in.ed.booktitle "booktitle" output.check
  603.       format.bvolume output
  604.       format.number.series output
  605.       format.pages output
  606.       address output                    % for apalike
  607.       new.sentence                    % there's no year
  608.       organization output                % here so things
  609.       publisher output                    % are simpler
  610.     }
  611.     { format.incoll.inproc.crossref output.nonnull
  612.       format.pages output
  613.     }
  614.   if$
  615.   new.block
  616.   note output
  617.   fin.entry
  618. }
  619.  
  620. FUNCTION {conference} { inproceedings }
  621.  
  622. FUNCTION {manual}
  623. { output.bibitem
  624.   format.authors output
  625.   author format.key output                % special for
  626.   output.year.check                    % apalike
  627.   new.block
  628.   format.btitle "title" output.check
  629.   organization address new.block.checkb
  630.   organization output
  631.   address output
  632.   format.edition output
  633.   new.block
  634.   note output
  635.   fin.entry
  636. }
  637.  
  638. FUNCTION {mastersthesis}
  639. { output.bibitem
  640.   format.authors "author" output.check
  641.   author format.key output                % special for
  642.   output.year.check                    % apalike
  643.   new.block
  644.   format.title "title" output.check
  645.   new.block
  646.   "Master's thesis" format.thesis.type output.nonnull
  647.   school "school" output.check
  648.   address output
  649.   new.block
  650.   note output
  651.   fin.entry
  652. }
  653.  
  654. FUNCTION {misc}
  655. { output.bibitem
  656.   format.authors output
  657.   author format.key output                % special for
  658.   output.year.check                    % apalike
  659.   new.block
  660.   format.title output
  661.   new.block
  662.   howpublished output
  663.   new.block
  664.   note output
  665.   fin.entry
  666. }
  667.  
  668. FUNCTION {phdthesis}
  669. { output.bibitem
  670.   format.authors "author" output.check
  671.   author format.key output                % special for
  672.   output.year.check                    % apalike
  673.   new.block
  674.   format.btitle "title" output.check
  675.   new.block
  676.   "PhD thesis" format.thesis.type output.nonnull
  677.   school "school" output.check
  678.   address output
  679.   new.block
  680.   note output
  681.   fin.entry
  682. }
  683.  
  684. FUNCTION {proceedings}
  685. { output.bibitem
  686.   format.editors output
  687.   editor format.key output                % special for
  688.   output.year.check                    % apalike
  689.   new.block
  690.   format.btitle "title" output.check
  691.   format.bvolume output
  692.   format.number.series output
  693.   address output                % for apalike
  694.   new.sentence                    % we always output
  695.   organization output                % a nonempty organization
  696.   publisher output                % here
  697.   new.block
  698.   note output
  699.   fin.entry
  700. }
  701.  
  702. FUNCTION {techreport}
  703. { output.bibitem
  704.   format.authors "author" output.check
  705.   author format.key output                % special for
  706.   output.year.check                    % apalike
  707.   new.block
  708.   format.title "title" output.check
  709.   new.block
  710.   format.tr.number output.nonnull
  711.   institution "institution" output.check
  712.   address output
  713.   new.block
  714.   note output
  715.   fin.entry
  716. }
  717.  
  718. FUNCTION {unpublished}
  719. { output.bibitem
  720.   format.authors "author" output.check
  721.   author format.key output                % special for
  722.   output.year.check                    % apalike
  723.   new.block
  724.   format.title "title" output.check
  725.   new.block
  726.   note "note" output.check
  727.   fin.entry
  728. }
  729.  
  730. FUNCTION {default.type} { misc }
  731.  
  732. MACRO {jan} {"January"}
  733.  
  734. MACRO {feb} {"February"}
  735.  
  736. MACRO {mar} {"March"}
  737.  
  738. MACRO {apr} {"April"}
  739.  
  740. MACRO {may} {"May"}
  741.  
  742. MACRO {jun} {"June"}
  743.  
  744. MACRO {jul} {"July"}
  745.  
  746. MACRO {aug} {"August"}
  747.  
  748. MACRO {sep} {"September"}
  749.  
  750. MACRO {oct} {"October"}
  751.  
  752. MACRO {nov} {"November"}
  753.  
  754. MACRO {dec} {"December"}
  755.  
  756. MACRO {acmcs} {"ACM Comput. Surv."}
  757.  
  758. MACRO {acta} {"Acta Inf."}
  759.  
  760. MACRO {cacm} {"Commun. ACM"}
  761.  
  762. MACRO {ibmjrd} {"IBM J. Res. Dev."}
  763.  
  764. MACRO {ibmsj} {"IBM Syst.~J."}
  765.  
  766. MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
  767.  
  768. MACRO {ieeetc} {"IEEE Trans. Comput."}
  769.  
  770. MACRO {ieeetcad}
  771.  {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
  772.  
  773. MACRO {ipl} {"Inf. Process. Lett."}
  774.  
  775. MACRO {jacm} {"J.~ACM"}
  776.  
  777. MACRO {jcss} {"J.~Comput. Syst. Sci."}
  778.  
  779. MACRO {scp} {"Sci. Comput. Programming"}
  780.  
  781. MACRO {sicomp} {"SIAM J. Comput."}
  782.  
  783. MACRO {tocs} {"ACM Trans. Comput. Syst."}
  784.  
  785. MACRO {tods} {"ACM Trans. Database Syst."}
  786.  
  787. MACRO {tog} {"ACM Trans. Gr."}
  788.  
  789. MACRO {toms} {"ACM Trans. Math. Softw."}
  790.  
  791. MACRO {toois} {"ACM Trans. Office Inf. Syst."}
  792.  
  793. MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
  794.  
  795. MACRO {tcs} {"Theoretical Comput. Sci."}
  796.  
  797. MACRO {advp} {"Adv. Phys."}
  798. MACRO {ajp} {"Am. J. Phys."}
  799. MACRO {ao} {"Appl. Opt."}
  800. MACRO {apl} {"Appl. Phys. Lett."}
  801. MACRO {apj} {"Astrophys. J."}
  802. MACRO {baps} {"Bull. Am. Phys. Soc."}
  803. MACRO {cpc} {"Computer Phys. Comm."}
  804. MACRO {cppcf} {"Comments Plasma Phys. Controlled Fusion"}
  805. MACRO {fed} {"Fusion Eng. Design"}
  806. MACRO {ft} {"Fusion Tech."}
  807. MACRO {ieeens} {"IEEE Trans. Nucl. Sci."}
  808. MACRO {ieeeps} {"IEEE Trans. Plasma Sci."}
  809. MACRO {ijimw} {"Int. J. Infrared Millimeter Waves"}
  810. MACRO {ip} {"Infrared Phys."}
  811. MACRO {jap} {"J. Appl. Phys."}
  812. MACRO {jcp} {"J. Comput. Phys."}
  813. MACRO {jetp} {"Sov. Phys.-JETP"}
  814. MACRO {jfe} {"J. Fusion Energy"}
  815. MACRO {jfm} {"J. Fluid Mech."}
  816. MACRO {jgr} {"J. Geophys. Res."}
  817. MACRO {jmp} {"J. Math. Phys."}
  818. MACRO {jne} {"J. Nucl. Energy"}
  819. MACRO {jnec} {"J. Nucl. Energy, Part C"}
  820. MACRO {jnm} {"J. Nucl. Mater."}
  821. MACRO {josa} {"J. Opt. Soc. Am."}
  822. MACRO {jpp} {"J. Plasma Phys."}
  823. MACRO {jpsj} {"J. Phys. Soc. Jpn"}
  824. MACRO {jvst} {"J. Vac. Sci. Technol."}
  825. MACRO {nedf} {"Nucl. Eng. Design/Fusion"}
  826. MACRO {nf} {"Nucl. Fusion"}
  827. MACRO {nim} {"Nucl. Instrum. Methods"}
  828. MACRO {nimpr} {"Nucl. Instrum. Methods Phys. Research"}
  829. MACRO {nt/f} {"Nucl. Tech./Fusion"}
  830. MACRO {pf} {"Phys. Fluids"}
  831. MACRO {pfa} {"Phys. Fluids A"}
  832. MACRO {pfb} {"Phys. Fluids B"}
  833. MACRO {pl} {"Phys. Lett."}
  834. MACRO {pla} {"Phys. Lett. A"}
  835. MACRO {pnas} {"Proc. Nat. Acad. Sci. USA"}
  836. MACRO {pp} {"Plasma Phys."}
  837. MACRO {ppcf} {"Plasma Phys. Controlled Fusion"}
  838. MACRO {prl} {"Phys. Rev. Lett."}
  839. MACRO {pr} {"Phys. Rev."}
  840. MACRO {pra} {"Phys. Rev. A"}
  841. MACRO {ps} {"Physica Scripta"}
  842. MACRO {rmp} {"Rev. Mod. Phys."}
  843. MACRO {rsi} {"Rev. Sci. Instrum."}
  844. MACRO {sjpp} {"Sov. J. Plasma Phys."}
  845. MACRO {spd} {"Sov. Phys.-Dokl."}
  846. MACRO {sptp} {"Sov. Phys.-Tech. Phys."}
  847. MACRO {spu} {"Sov. Phys.-Usp."}
  848.  
  849. READ
  850.  
  851. FUNCTION {sortify}
  852. { purify$
  853.   "l" change.case$
  854. }
  855.  
  856. INTEGERS { len }
  857.  
  858. FUNCTION {chop.word}
  859. { 's :=
  860.   'len :=
  861.   s #1 len substring$ =
  862.     { s len #1 + global.max$ substring$ }
  863.     's
  864.   if$
  865. }
  866.  
  867. FUNCTION {format.lab.names}
  868. { 's :=
  869.   s #1 "{vv~}{ll}" format.name$ caps
  870.   s num.names$ duplicate$
  871.   #2 >
  872.     { pop$ " {\em et~al.}" * }
  873.     { #2 <
  874.     'skip$
  875.     { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  876.         { " {\em et~al.}" * }
  877.         { " and " * s #2 "{vv~}{ll}" format.name$ caps * }
  878.       if$
  879.     }
  880.       if$
  881.     }
  882.   if$
  883. }
  884.  
  885. FUNCTION {author.key.label}
  886. { author empty$
  887.     { key empty$
  888.     { cite$ #1 #3 substring$ }
  889.     'key                    % apalike uses the whole key
  890.       if$
  891.     }
  892.     { author format.lab.names }
  893.   if$
  894. }
  895.  
  896. FUNCTION {author.editor.key.label}
  897. { author empty$
  898.     { editor empty$
  899.     { key empty$
  900.         { cite$ #1 #3 substring$ }
  901.         'key                % apalike uses the whole key
  902.       if$
  903.     }
  904.     { editor format.lab.names }
  905.       if$
  906.     }
  907.     { author format.lab.names }
  908.   if$
  909. }
  910.  
  911. FUNCTION {editor.key.label}
  912. { editor empty$
  913.     { key empty$
  914.     { cite$ #1 #3 substring$ }
  915.     'key            % apalike uses the whole key, no organization
  916.       if$
  917.     }
  918.     { editor format.lab.names }
  919.   if$
  920. }
  921.  
  922. FUNCTION {calc.label}
  923. { type$ "book" =
  924.   type$ "inbook" =
  925.   or
  926.     'author.editor.key.label
  927.     { type$ "proceedings" =
  928.     'editor.key.label            % apalike ignores organization
  929.     'author.key.label            % for labeling and sorting
  930.       if$
  931.     }
  932.   if$
  933.   ", "                            % these three lines are
  934.   *                            % for apalike, which
  935.   year field.or.null purify$ #-1 #4 substring$        % uses all four digits
  936.   *
  937.   'label :=
  938. }
  939.  
  940. FUNCTION {sort.format.names}
  941. { 's :=
  942.   #1 'nameptr :=
  943.   ""
  944.   s num.names$ 'numnames :=
  945.   numnames 'namesleft :=
  946.     { namesleft #0 > }
  947.     { nameptr #1 >
  948.     { "   " * }
  949.     'skip$
  950.       if$                        % apalike uses initials
  951.       s nameptr "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}" format.name$ 't := % <= here
  952.       nameptr numnames = t "others" = and
  953.     { "et al" * }
  954.     { t sortify * }
  955.       if$
  956.       nameptr #1 + 'nameptr :=
  957.       namesleft #1 - 'namesleft :=
  958.     }
  959.   while$
  960. }
  961.  
  962. FUNCTION {sort.format.title}
  963. { 't :=
  964.   "A " #2
  965.     "An " #3
  966.       "The " #4 t chop.word
  967.     chop.word
  968.   chop.word
  969.   sortify
  970.   #1 global.max$ substring$
  971. }
  972.  
  973. FUNCTION {author.sort}
  974. { author empty$
  975.     { key empty$
  976.     { "to sort, need author or key in " cite$ * warning$
  977.       ""
  978.     }
  979.     { key sortify }
  980.       if$
  981.     }
  982.     { author sort.format.names }
  983.   if$
  984. }
  985.  
  986. FUNCTION {author.editor.sort}
  987. { author empty$
  988.     { editor empty$
  989.     { key empty$
  990.         { "to sort, need author, editor, or key in " cite$ * warning$
  991.           ""
  992.         }
  993.         { key sortify }
  994.       if$
  995.     }
  996.     { editor sort.format.names }
  997.       if$
  998.     }
  999.     { author sort.format.names }
  1000.   if$
  1001. }
  1002.  
  1003. FUNCTION {editor.sort}
  1004. { editor empty$
  1005.     { key empty$
  1006.     { "to sort, need editor or key in " cite$ * warning$
  1007.       ""
  1008.     }
  1009.     { key sortify }
  1010.       if$
  1011.     }
  1012.     { editor sort.format.names }
  1013.   if$
  1014. }
  1015.  
  1016. FUNCTION {presort}
  1017. { calc.label
  1018.   label sortify
  1019.   "    "
  1020.   *
  1021.   type$ "book" =
  1022.   type$ "inbook" =
  1023.   or
  1024.     'author.editor.sort
  1025.     { type$ "proceedings" =
  1026.     'editor.sort
  1027.     'author.sort
  1028.       if$
  1029.     }
  1030.   if$
  1031.   #1 entry.max$ substring$    % for
  1032.   'sort.label :=        % apalike
  1033.   sort.label            % style
  1034.   *
  1035.   "    "
  1036.   *
  1037.   title field.or.null
  1038.   sort.format.title
  1039.   *
  1040.   #1 entry.max$ substring$
  1041.   'sort.key$ :=
  1042. }
  1043.  
  1044. ITERATE {presort}
  1045.  
  1046. SORT        % by label, sort.label, title---for final label calculation
  1047.  
  1048. STRINGS { last.label next.extra }    % apalike labels are only for the text;
  1049.  
  1050. INTEGERS { last.extra.num }        % there are none in the bibliography
  1051.  
  1052. FUNCTION {initialize.extra.label.stuff}    % and hence there is no `longest.label'
  1053. { #0 int.to.chr$ 'last.label :=
  1054.   "" 'next.extra :=
  1055.   #0 'last.extra.num :=
  1056. }
  1057.  
  1058. FUNCTION {forward.pass}
  1059. { last.label label =
  1060.     { last.extra.num #1 + 'last.extra.num :=
  1061.       last.extra.num int.to.chr$ 'extra.label :=
  1062.     }
  1063.     { "a" chr.to.int$ 'last.extra.num :=
  1064.       "" 'extra.label :=
  1065.       label 'last.label :=
  1066.     }
  1067.   if$
  1068. }
  1069.  
  1070. FUNCTION {reverse.pass}
  1071. { next.extra "b" =
  1072.     { "a" 'extra.label := }
  1073.     'skip$
  1074.   if$
  1075.   label extra.label * 'label :=
  1076.   extra.label 'next.extra :=
  1077. }
  1078.  
  1079. EXECUTE {initialize.extra.label.stuff}
  1080.  
  1081. ITERATE {forward.pass}
  1082.  
  1083. REVERSE {reverse.pass}
  1084.  
  1085. FUNCTION {bib.sort.order}
  1086. { sort.label
  1087.   "    "
  1088.   *
  1089.   year field.or.null sortify
  1090.   *
  1091.   "    "
  1092.   *
  1093.   title field.or.null
  1094.   sort.format.title
  1095.   *
  1096.   #1 entry.max$ substring$
  1097.   'sort.key$ :=
  1098. }
  1099.  
  1100. ITERATE {bib.sort.order}
  1101.  
  1102. SORT        % by sort.label, year, title---giving final bibliography order
  1103.  
  1104. FUNCTION {begin.bib}
  1105. { preamble$ empty$                % no \etalchar in apalike
  1106.     'skip$
  1107.     { preamble$ write$ newline$ }
  1108.   if$
  1109.   "\begin{thebibliography}{}" write$ newline$        % no labels in apalike
  1110. }
  1111.  
  1112. EXECUTE {begin.bib}
  1113.  
  1114. EXECUTE {init.state.consts}
  1115.  
  1116. ITERATE {call.type$}
  1117.  
  1118. FUNCTION {end.bib}
  1119. { newline$
  1120.   "\end{thebibliography}" write$ newline$
  1121. }
  1122.  
  1123. EXECUTE {end.bib}
  1124.